package com.zhu.service;

import com.spring.*;

@Component("userService")
@Scope("singleton")//原型bean(多例bean)
public class UserService implements InitializingBean,UserInterface, BeanNameAware {
    @Autowired
    private OrderService orderService;
    @ZhuValue("自定义注解")
    private String name;
    private String beanName;
    public void test(){
        System.out.println(name);
        System.out.println("beanName:"+beanName);

    }


    @Override
    public void afterPropertiesSet() {
        System.out.println("初始化");
    }

    @Override
    public void setBeanName(String name) {
        this.beanName=name;
    }
}
